package cho08;

import java.util.Scanner;

/**
 * Created by 春旺 on 2017/4/6.
 */
public class TestMonetaryCoin
{
    public static void main(String[] args) {

         int a, sum = 0;
        String another = "y";
        Scanner scan = new Scanner(System.in);
        while (another.equalsIgnoreCase("y"))
        {
            System.out.println("Please enter the value of coin");
            a = scan.nextInt();
            MonetaryCoin coin = new MonetaryCoin();
            coin.MonetaryCoin(a);
            sum += coin.MonetaryCoin(a);
            System.out.println(sum);
            System.out.println("Do you want to enter another coin(y/n)");
            Scanner scan2 = new Scanner(System.in);
            another = scan2.nextLine();
        }
    }
}
